package org.jin.jinaicode.service;

import com.mybatisflex.core.service.IService;
import jakarta.servlet.http.HttpServletRequest;
import org.jin.jinaicode.common.BaseResponse;
import org.jin.jinaicode.model.dto.user.UserUpdateDTO;
import org.jin.jinaicode.model.entity.User;
import org.jin.jinaicode.model.vo.UserLoginVO;
import org.jin.jinaicode.model.vo.UserRegisterVO;

/**
 * 用户 服务层。
 *
 * @author 小堇
 */
public interface UserService extends IService<User> {

     // 用户注册
     BaseResponse<UserRegisterVO> userRegister(String userAccount, String email, String captcha, String userPassword,
               String checkPassword, String inviteUtm);

     // 用户登录
     BaseResponse<UserLoginVO> userLogin(String userAccount, String email, String userPassword,
               HttpServletRequest request);

     // 用户信息脱敏
     UserLoginVO getLoginUserVO(User user);

     // 获取当前登录用户
     User getLoginUser(HttpServletRequest request);

     // 更新用户信息
     BaseResponse<UserLoginVO> updateUserInfo(UserUpdateDTO userUpdateDTO, HttpServletRequest request);

     // 验证邮箱格式是否正确
     boolean isValidEmail(String email);
}
